package com.bp.hearthealth.pulse.lnapps.bp_utils

import kotlin.random.Random

object RandomStringUtil {

    private const val CHAR_POOL = "_abcdefghijklmnopqrstuvwxyz-ABCDEFGHIJKLMNOPQRSTUVWXYZ-0123456789_"

    fun generateRandomString(length: Int): String {
        val stringBuilder = StringBuilder(length)
        repeat(length) {
            val randomIndex = Random.nextInt(CHAR_POOL.length)
            stringBuilder.append(CHAR_POOL[randomIndex])
        }
        return stringBuilder.toString()
    }
}